#cgi script to run whatever command is passed in
#eg http://server:port/cgi-bin/run_command.py?command=whatever
#.../webdir/cgi-bin/run_command.py

import cgi

form = cgi.FieldStorage()
print "Content-type: text/html"

html = """
<TITLE>MiRControl v.1</TITLE>
<H1>MiRControl</H1>
<P>Running Command: %s</P>
"""

if not form.has_key('command'):
	command = "NONE"
else:
	command = form['command'].value
	#call other program or exec command here...after doing imput validation of course :)

print html % (command)